package com.eleme.order.mapper;

import com.eleme.order.entity.Order;
import com.neusoft.po.Orders;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;

import java.util.List;

@Mapper
public interface OrderMapper {

    @Insert("insert into orders(userId,businessId,orderDate,orderTotal,daId,orderState) values(#{userId},#{businessId},#{orderDate},#{orderTotal},#{daId},0)")
    @Options(useGeneratedKeys=true,keyProperty="orderId",keyColumn="orderId")
    public int saveOrders(Order order);

    public Order getOrdersById(Integer orderId);
    public List<Order> listOrdersByUserId(String userId);
}
